<?php
namespace app\index\controller;
use \think\Controller;
class Article extends Controller
{

	public function index()
	{
		$data = db('Article')->limit(10)->order('update_time DESC')->select();
		$this->assign('data', $data);
		return view('article/index');
	}

	public function category()
	{
		$data = db('Article')->order('create_time DESC')->select();
		$this->assign('data', $data);
		return view('article/category');
	}

	public function detail($id)
	{
		$data = db('Article')->where(array('id' => $id))->find();
		$this->assign('data', $data);
		return view('article/detail');
	}

}